package com.zhidisoft.admin.controller;

import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
/**
 * 将当前用户session提取出来，需要session对象时，可以直接继承这个类
 * @author MySpace
 *
 */
public class BaseController {

	@Autowired
	HttpServletRequest request;
	public String getCurUser() {
		Object user = request.getSession().getAttribute("userId");
		if (user==null) {
			return "";
		}
		return user.toString();
	}
}
